package co.yixiang.modules.shop.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
* @author lijunze
* @date 2020-05-08
*/
@Entity
@Data
@Table(name="driver_work_info")
public class DriverWorkInfo implements Serializable {

    /** id */
    @Id
    @Column(name = "id")
    private Integer id;

    /** 用户id */
    @Column(name = "user_id")
    private Integer userId;

    /** 标题 */
    @Column(name = "title")
    private String title;

    /** 手机号 */
    @Column(name = "phone")
    private String phone;

    /** 年限 */
    @Column(name = "years")
    private Integer years;

    /** 省 */
    @Column(name = "province")
    private String province;

    /** 市 */
    @Column(name = "city")
    private String city;

    /** 区 */
    @Column(name = "district")
    private String district;

    /** 薪资下限 */
    @Column(name = "salary_min")
    private Integer salaryMin;

    /** 薪资上限 */
    @Column(name = "salary_max")
    private Integer salaryMax;

    /** 具体内容 */
    @Column(name = "message")
    private String message;

    /** 图片 */
    @Column(name = "image")
    private String image;

    /** 阅读次数 */
    @Column(name = "count_number")
    private Integer countNumber;

    /** 创建时间 */
    @Column(name = "create_time")
    private LocalDateTime createTime;

    /** 是否删除 */
    @Column(name = "del_flag")
    private Integer delFlag;

    public void copy(DriverWorkInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}